define(["jquery",
	"scprit/nutrition/app/foodLibrary/editFood.servers.js",
    "scprit/nutrition/app/foodLibrary/editFood.ui.js",
    "scprit/nutrition/app/foodLibrary/editFood.event.js"],
    function($,$servers,$ui,$event){
	var editFood = {};

	/**
     * 查询食品库成功后的回调函数
     */
    var ajaxFoodlibraryCallBack = function(data){
        $ui.foodLibirayTabInit({
            "id":"foodLibirayTab",
            "list":data,
            "foodLibraryId":$servers.getPageParams()
        });
        $("#foodLibirayTab select").change($event.onfoodLibirayChange);
        $("#foodLibirayTab select").change();
    }

	editFood.init = function(){
		$servers.ajaxFoodlibrary(ajaxFoodlibraryCallBack);
    };

	return editFood;
});